package cn.njxzc.examples;

import java.io.File;
import java.io.IOException;

public class Exam9_26 {
	public static void main(String[] args) throws IOException {
		File testfile = new File("testfile3");
		testfile.delete();
		testfile.createNewFile();
		if (testfile.canRead())
			System.out.println("file can be read #1");
		if (testfile.canWrite())
			System.out.println("file can be written #1");
		testfile.setReadOnly();
		if (testfile.canRead())
			System.out.println("file can be read #2");
		if (testfile.canWrite())
			System.out.println("file can be written #2");
	}
}
